<?php
require_once dirname(__FILE__) . '/../../../incls/php/dbutils.class.php';
require_once dirname(__FILE__) . '/../../../incls/php/miscutils.class.php';
require_once dirname(__FILE__) . '/../../../incls/php/config.php';
session_name(SESSION);
session_start();
$_SESSION[TINYMCE_UPLOAD] = 'uploads/admin/';
$myPdo = DbUtils::createPdoInst();
$page_id = MiscUtils::getParam('i', 0);
$inst_id = MiscUtils::getParam('inid', 0);

$items = DbUtils::get($myPdo, TABLE_NAME_PREFIX_PLUGIN . 'admin_hm_gallery', NULL, 't.order_number', 'ASC', NULL, NULL, NULL)->d;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <title>jquery sliders</title>
  <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
  <script type="text/javascript">var _siteRoot='index.php',_root='index.php';</script>
  <script type="text/javascript" src="js/jquery.js"></script>
  <script type="text/javascript" src="js/scripts.js"></script>
</head>
<body>
  <!--/top-->
  <div id="header"><div class="wrap">
    <div id="slide-holder">
      <div id="slide-runner">
        <?php foreach($items as &$item) { ?>
        <a href="#" <?php if ($item->url != '') { ?>onclick="parent.location.href='<?php echo $item->url; ?>';"<?php } ?>><img id="slide-img-<?php echo $item->id; ?>" style="width: 100%;height: 250px;" src="<?php echo $item->file; ?>" class="slide" alt="" /></a>
        <?php } ?>
        <div id="slide-controls">
          <p id="slide-desc" class="text" style="width: 250px; height: 20px;"></p>
          <p id="slide-nav"></p>
        </div>
      </div>
    <!--content featured gallery here -->
     </div>
     <script type="text/javascript">
      if(!window.slider) var slider={};
      slider.data=[<?php foreach($items as $idx => &$item) { ?>
                   {"id":"slide-img-<?php echo $item->id; ?>","client":"","desc":"<?php echo strip_tags($item->title); ?>"}<?php if ($idx < count($items) - 1) { ?>,<?php } ?>
                   <?php } ?>];
     </script>
    </div>
  </div>
 </body>
</html>
